package com.yang.action;

import com.yang.service.IndexService;
import com.yang.util.RespEntity;
import com.yang.util.RespUtil;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

@WebServlet("/indexInit")
public class indexInitAction extends HttpServlet {
    //初始化方法
    protected void service(HttpServletRequest req, HttpServletResponse resp) throws ServletException, IOException {
        //初始化servic方法
        IndexService indexService = new IndexService();
        //service 调用初始化方法
        RespEntity respEntity = indexService.indexInit();
        //返回流
        RespUtil respUtil = new RespUtil();
        respUtil.sendJSON(resp, respEntity);
    }
}
